﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.Data.Linq.Mapping;

namespace FY13.Data
{
    [Table]
    public class UserInfo : BaseTable
    {
        private int id;

        [Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
        public int ID
        {
            get
            {
                return id;
            }
            set
            {
                if (id != value)
                {
                    NotifyPropertyChanging("ID");
                    id = value;
                    NotifyPropertyChanged("ID");
                }
            }
        }


        private string chineseName;
        [Column]
        public string ChineseName
        {
            get
            {
                return chineseName;
            }
            set
            {
                if (chineseName != value)
                {
                    NotifyPropertyChanging("ChineseName");
                    chineseName = value;
                    NotifyPropertyChanged("ChineseName");
                }
            }
        }

        private string displayName;
        [Column]
        public string DisplayName
        {
            get
            {
                return displayName;
            }
            set
            {
                if (displayName != value)
                {
                    NotifyPropertyChanging("DisplayName");
                    displayName = value;
                    NotifyPropertyChanged("DisplayName");
                }
            }
        }

        private string email;
        [Column]
        public string Email
        {
            get
            {
                return email;
            }
            set
            {
                if (email != value)
                {
                    NotifyPropertyChanging("Email");
                    email = value;
                    NotifyPropertyChanged("Email");
                }
            }
        }


        private string password;
        [Column]
        public string Password
        {
            get
            {
                return password;
            }
            set
            {
                if (password != value)
                {
                    NotifyPropertyChanging("Password");
                    password = value;
                    NotifyPropertyChanged("Password");
                }
            }
        }


        private string departureTerminal;
        [Column]
        public string DepartureTerminal
        {
            get
            {
                return departureTerminal;
            }
            set
            {
                if (departureTerminal != value)
                {
                    NotifyPropertyChanging("DepartureTerminal");
                    departureTerminal = value;
                    NotifyPropertyChanged("DepartureTerminal");
                }
            }
        }


        private string departureTrip;
        [Column]
        public string DepartureTrip
        {
            get
            {
                return departureTrip;
            }
            set
            {
                if (departureTrip != value)
                {
                    NotifyPropertyChanging("DepartureTrip");
                    departureTrip = value;
                    NotifyPropertyChanged("DepartureTrip");
                }
            }
        }

        private string departureDate;
        [Column]
        public string DepartureDate
        {
            get
            {
                return departureDate;
            }
            set
            {
                if (departureDate != value)
                {
                    NotifyPropertyChanging("DepartureDate");
                    departureDate = value;
                    NotifyPropertyChanged("DepartureDate");
                }
            }
        }

        private string departureFlight;
        [Column]
        public string DepartureFlight
        {
            get
            {
                return departureFlight;
            }
            set
            {
                if (departureFlight != value)
                {
                    NotifyPropertyChanging("DepartureFlight");
                    departureFlight = value;
                    NotifyPropertyChanged("DepartureFlight");
                }
            }
        }

        private string returnTerminal;
        [Column]
        public string ReturnTerminal
        {
            get
            {
                return returnTerminal;
            }
            set
            {
                if (returnTerminal != value)
                {
                    NotifyPropertyChanging("ReturnTerminal");
                    returnTerminal = value;
                    NotifyPropertyChanged("ReturnTerminal");
                }
            }
        }

        private string returnTrip;
        [Column]
        public string ReturnTrip
        {
            get
            {
                return returnTrip;
            }
            set
            {
                if (returnTrip != value)
                {
                    NotifyPropertyChanging("ReturnTrip");
                    returnTrip = value;
                    NotifyPropertyChanged("ReturnTrip");
                }
            }
        }

        private string returnFlight;
        [Column]
        public string ReturnFlight
        {
            get
            {
                return returnFlight;
            }
            set
            {
                if (returnFlight != value)
                {
                    NotifyPropertyChanging("ReturnFlight");
                    returnFlight = value;
                    NotifyPropertyChanged("ReturnFlight");
                }
            }
        }

        private string returnFlightLeader;
        [Column]
        public string ReturnFlightLeader
        {
            get
            {
                return returnFlightLeader;
            }
            set
            {
                if (returnFlightLeader != value)
                {
                    NotifyPropertyChanging("ReturnFlightLeader");
                    returnFlightLeader = value;
                    NotifyPropertyChanged("ReturnFlightLeader");
                }
            }
        }


        private string departureFlightLeader;
        [Column]
        public string DepartureFlightLeader
        {
            get
            {
                return departureFlightLeader;
            }
            set
            {
                if (departureFlightLeader != value)
                {
                    NotifyPropertyChanging("DepartureFlightLeader");
                    departureFlightLeader = value;
                    NotifyPropertyChanged("DepartureFlightLeader");
                }
            }
        }

        private string shuttleHotelToAirport;
        [Column]
        public string ShuttleHotelToAirport
        {
            get
            {
                return shuttleHotelToAirport;
            }
            set
            {
                if (shuttleHotelToAirport != value)
                {
                    NotifyPropertyChanging("ShuttleHotelToAirport");
                    shuttleHotelToAirport = value;
                    NotifyPropertyChanged("ShuttleHotelToAirport");
                }
            }
        }

        private string roommateName;
        [Column]
        public string RoommateName
        {
            get
            {
                return roommateName;
            }
            set
            {
                if (roommateName != value)
                {
                    NotifyPropertyChanging("RoommateName");
                    roommateName = value;
                    NotifyPropertyChanged("RoommateName");
                }
            }
        }

        private string tourBus;
        [Column]
        public string TourBus
        {
            get
            {
                return tourBus;
            }
            set
            {
                if (tourBus != value)
                {
                    NotifyPropertyChanging("TourBus");
                    tourBus = value;
                    NotifyPropertyChanged("TourBus");
                }
            }
        }


        private string returnDate;
        [Column]
        public string ReturnDate
        {
            get
            {
                return returnDate;
            }
            set
            {
                if (returnDate != value)
                {
                    NotifyPropertyChanging("ReturnDate");
                    returnDate = value;
                    NotifyPropertyChanged("ReturnDate");
                }
            }
        }

        private string hotelCheckOutTime;
        [Column]
        public string HotelCheckOutTime
        {
            get
            {
                return hotelCheckOutTime;
            }
            set
            {
                if (hotelCheckOutTime != value)
                {
                    NotifyPropertyChanging("HotelCheckOutTime");
                    hotelCheckOutTime = value;
                    NotifyPropertyChanged("HotelCheckOutTime");
                }
            }
        }
    }

    public abstract class BaseTable : INotifyPropertyChanged, INotifyPropertyChanging
    {
        public event PropertyChangedEventHandler PropertyChanged;

        public event PropertyChangingEventHandler PropertyChanging;

        protected void NotifyPropertyChanging(string name)
        {
            if (PropertyChanging != null)
                PropertyChanging(this, new PropertyChangingEventArgs(name));
        }

        protected void NotifyPropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(name));
        }
    }
}
